 //找到网页上的图画的位置，并且用echarts初始化这个区域
 var myChart = echarts.init(document.getElementById("idx1"));
 //配置绘制参数
 var option = {
    title: {
        text:'产品折线图--章玉景',
        left: 'center',
    },
       xAxis: {
        type:'category',
        data: ["2012","2014","2015","2016","2017","2018","2019","2020"],
        name:'年份',
       },
     yAxis: {
         name:"产量"
     },
     toolbox: { 
         feature: {
             saveAsImage: {}, //保存成图片
             dataView: {},
             dataZoom: {},
             restore: {},
           //brush: {},
         },
     },
     legend:{
        top:'bottom',
    },
     series:[ {
        type:'line',
        data: [400,600, 700,700,100,400,400, 600,700],
        name:"产品A",
        smooth: false,
   },{
        type:'line',
        data: [400, 500,500,500,500,400,400, 500,500],
        name:"产品B",
        smooth: false,
   },{
        type:'line',
        data:[400,400,300,300,300, 400,400, 400,300],
        name:"产品C",
        smooth: false,
   }] 
};
//画图
myChart.setOption(option);
//--------------------------------------------------------------------
 //找到网页上的图画的位置，并且用echarts初始化这个区域
 var myChart2 = echarts.init(document.getElementById("idx2"));
 //配置绘制参数
 var option2 = {
    title: {
        text:'产品面积图--章玉景',
        left: 'center',
    },
       xAxis: {
        type:'category',
        data: ["2012","2014","2015","2016","2017","2018","2019","2020"],
        name:'年份',
       },
     yAxis: {
         name:"产量"
     },
     toolbox: { 
         feature: {
             saveAsImage: {}, //保存成图片
             dataView: {},
             dataZoom: {},
             restore: {},
           //brush: {},
         },
     },
     legend:{
        top:'bottom',
    },
     series:[ {
        type:'line',
        data: [400,600, 700,700,100,400,400, 600,700],
        name:"产品A",
        smooth: false,
        areaStyle: {},
         stack: '总量',
         label: {
             show:true
         },
   },{
        type:'line',
        data: [400, 500,500,500,500,400,400, 500,500],
        name:"产品B",
        smooth: false,
        areaStyle: {},
         stack: '总量',
         label: {
             show:true
         },
   },{
        type:'line',
        data:[400,400,300,300,300, 400,400, 400,300],
        name:"产品C",
        smooth: false,
        areaStyle: {},
         stack: '总量',
         label: {
             show:true
         },
   }] 
};
//画图
myChart2.setOption(option2);